<!-- 医院端配送准入 审核页-->
<template>
  <div class="distribution-admittance-examine">
    <el-container class="template-box">
      <el-header
        height="auto"
        style="padding:0;">
        <h3
          class="reject-box"
          v-show="authState==5">
          <span>备注：</span>
          <span>{{ this.detailInfo.remark || '--' }}</span>
        </h3>
        <h3>配送商：{{ this.detailInfo.supplierName|| '--' }}</h3>
      </el-header>
      <!-- tab部分 -->
      <el-tabs
        v-model="activeName"
        @tab-click="handleClick">
        <el-tab-pane
          label="企业信息"
          name="1">
          <!-- 基本信息 -->
          <RecordInfo
            :record-form="enterpriseForm"
            :record-data="enterpriseInfo">
            <span slot="businessScope">
              <el-checkbox-group v-model="enterpriseInfo['businessScope']">
                <el-checkbox
                  v-for="item in businessScope"
                  :key="item.key"
                  :label="item.key"
                  disabled
                >{{ item.label }}</el-checkbox>
              </el-checkbox-group>
            </span>
          </RecordInfo>
          <!-- 财务信息 -->
          <h3>财务信息</h3>
          <RecordInfo
            :record-form="financeForm"
            :record-data="financeInfo" />
          <h3>证照信息</h3>
          <!-- <div
            v-if="licenceInfo&&licenceInfo.length"
            class="licence-box"
            ref="licenceBox"
            v-viewer>
            <div
              class="licence-every-box"
              v-for="(item,index) in licenceInfo"
              :key="index">
              <div class="licence-url-box">
                <el-image
                  v-if="item.type === 'pdf'"
                  style="width: 0; height: 0;"
                  :src="defaultImgUrl"
                  fit="cover"
                />
                <template v-if="item.type === 'pdf'">
                  <i class="iconfont iconpdf" />
                </template>
                <el-image
                  v-else
                  style="width: 250px; height: 150px;"
                  :src="item.url"
                  fit="cover" />
              </div>
              <div class="licence-button-box">
                <span>
                  <el-button
                    type="text"
                    @click="previewFile(item,index,'licenceBox')">查看</el-button>
                </span>
                <span>
                  <el-button
                    type="text"
                    @click="downloadFile(item.url)">下载</el-button>
                </span>
              </div>
            </div>
          </div> -->
          <div
            class="card-box"
            v-if="licenceInfo&&licenceInfo.length">
            <el-card
              class="licenceCard"
              v-for="(i, index) in licenceInfo"
              :key="'c' + index"
            >
              <pic-info-card :card-data="i.licenceInfo" />
            </el-card>
          </div>
          <h3>补充信息</h3>
          <RecordInfo
            :record-form="supplementForm"
            :record-data="supplementInfo" />
        </el-tab-pane>
        <el-tab-pane
          label="销售员"
          name="2">
          <div
            v-for="(salerItem,salerItemIndex) in salerList"
            :key="salerItemIndex"
            :class="{'saler-item-info': salerList.length>1}"
          >
            <p>销售员信息</p>
            <RecordInfo
              :record-form="salespersonForm"
              :record-data="salerItem" />
            <h3>身份证信息</h3>
            <RecordInfo
              :record-form="IDcardsForm"
              :record-data="salerItem" />
            <!-- 身份证 -->
            <div
              class="licence-box"
              v-viewer
              :ref="'idCard' + salerItemIndex">
              <div
                class="licence-every-box"
                v-for="(item,index) in salerItem.IDcardsArr"
                :key="index"
              >
                <div class="licence-url-box">
                  <el-image
                    style="width: 250px; height: 150px;"
                    :src="item.url"
                    fit="cover" />
                </div>
                <div class="licence-button-box">
                  <span>
                    <el-button
                      type="text"
                      @click="previewFile(item,index,'idCard' + salerItemIndex ,1)"
                    >查看</el-button>
                  </span>
                  <span>
                    <el-button
                      type="text"
                      @click="downloadFile(item.url)">下载</el-button>
                  </span>
                </div>
              </div>
            </div>
            <h3>授权书</h3>
            <div
              class="licence-box"
              v-viewer
              :ref="'authorizationBook'+salerItemIndex">
              <div
                class="licence-every-box"
                v-for="(item,index) in salerItem.saler"
                :key="index">
                <div class="licence-url-box">
                  <el-image
                    v-if="item.type === 'pdf'"
                    style="width: 0; height: 0;"
                    :src="defaultImgUrl"
                    fit="cover"
                  />
                  <template v-if="item.type === 'pdf'">
                    <i class="iconfont iconpdf"/>
                  </template>
                  <el-image
                    v-else
                    style="width: 250px; height: 150px;"
                    :src="item.url"
                    fit="cover"
                  />
                </div>
                <div class="licence-button-box">
                  <span>
                    <el-button
                      type="text"
                      @click="previewFile(item,index,'authorizationBook'+salerItemIndex,1)"
                    >查看</el-button>
                  </span>
                  <span>
                    <el-button
                      type="text"
                      @click="downloadFile(item.url)">下载</el-button>
                  </span>
                </div>
              </div>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane
          label="申请准入产品"
          name="3">
          <!-- 搜索 -->
          <SearchForm
            label-width="80px"
            :data="searchDataForm"
            @searchForm="searchForm"
            @resetForm="resetForm"
            :submit-loading="submitLoading"
          />
          <!-- 产品数据 -->
          <el-tabs
            v-model="activeNameProduct"
            @tab-click="handleClickLookProduct">
            <el-tab-pane
              label="按产品查看"
              name="1" />
            <el-tab-pane
              label="按注册证查看"
              name="2" />
          </el-tabs>
          <el-editable
            v-show="activeNameProduct==1"
            v-loading="tableLoading"
            :data="dataList"
            height="400"
            :columns="productColumns"
          >
            <!-- 院内编码 -->
            <template
              slot="default-hosProdCode"
              slot-scope="scope">
              <div
                style="display:flex;"
                v-if="changeHosProdCode">
                <el-select
                  filterable
                  remote
                  placeholder="请输入院内编码"
                  :disabled="!scope.row.isEditcode"
                  :remote-method="remoteRequestAsync"
                  :loading="hosProdCodeLoading"
                  @focus="hosProdCodeListAndhosProdIdInit"
                  @change="gethosProdId"
                  v-model="scope.row.hosProdCode"
                >
                  <el-option
                    v-for="item in hosProdCodeList"
                    :key="item.companyProdCode"
                    :label="item.companyProdCode"
                    :value="item.companyProdCode"
                  />
                </el-select>
                <el-button
                  v-if="!scope.row.isEditcode"
                  size="small"
                  @click.stop="editHosProdCode(scope.row)"
                  type="text text-primary"
                >编辑</el-button>
                <el-button
                  v-else
                  size="small"
                  @click.stop="updateHosProdCodeById(scope.row)"
                  type="text text-primary"
                >确定</el-button>
              </div>
              <div v-else>{{ scope.row.hosProdCode ? scope.row.hosProdCode : '--' }}</div>
            </template>
            <!--注册证号预览-->
            <template
              slot="default-registNo"
              slot-scope="scope">
              <div>
                <cell-registration
                  :key="scope.row.registNo"
                  :regis-no="scope.row.registNo"
                  :content="'注册证已过期，点击查看详细信息'"
                  :status="scope.row.expireStatus"
                  :regis-data="scope.row.registInfo"
                />
              </div>
            </template>
            <!-- 查看资质 -->
            <template
              slot="default-qualificationView"
              slot-scope="scope">
              <el-button
                size="small"
                @click.stop="lookQualifications(scope.row)"
                type="text text-primary"
              >查看</el-button>
            </template>
            <!-- 查看历史记录 -->
            <template
              slot="default-history"
              slot-scope="scope">
              <el-button
                size="small"
                @click.stop="lookHistory(scope.row)"
                type="text text-primary"
              >查看</el-button>
            </template>
            <!--// 注册证预览-->
            <!-- <template
              slot="default-registNo"
              slot-scope="scope">
              <el-button
                :disabled="!scope.row.registNo||!scope.row.registId"
                v-html="regisNoButton(scope.row, ['registNo', 'registId'])"
                @click="showPdfRegistion(scope.row.registId)"
                type="text"
              />
            </template> -->
            <!-- <div
              slot="default-registNo"
              slot-scope="scope">
              <el-button
                size="small"
                @click.stop="viewCertificate(scope.row.pictureUrl)"
                type="text text-primary"
              >{{ scope.row.registNo }}</el-button>
            </div> -->
          </el-editable>
          <el-editable
            v-show="activeNameProduct==2"
            v-loading="tableLoading"
            :data="dataList"
            height="400"
            :columns="registerColumns"
          >
            <!-- 操作 -->
            <template
              slot="default-action"
              slot-scope="scope">
              <el-button
                size="small"
                @click.stop="lookProduct(scope.row)"
                type="text text-primary"
              >查看产品</el-button>
            </template>
            <!--注册证号预览-->
            <template
              slot="default-registNo"
              slot-scope="scope">
              <div>
                <cell-registration
                  :key="scope.row.registNo"
                  :regis-no="scope.row.registNo"
                  :content="'注册证已过期，点击查看详细信息'"
                  :status="scope.row.expireStatus"
                  :regis-data="scope.row.registInfo"
                />
              </div>
            </template>
            <!--// 预览注册证、备案编号-->
            <!-- <div
              slot="default-registNo"
              slot-scope="scope">
              <el-button
                size="small"
                @click.stop="viewCertificate(scope.row.registUrl)"
                type="text text-primary"
              >{{ scope.row.registNo }}</el-button>
              <div
                v-viewer
                class="registration"
                v-show="false">
                <el-image
                  style="width: 250px; height: 150px;"
                  :src="scope.row.registUrl"
                  fit="cover" />
              </div>
            </div> -->
          </el-editable>
          <el-pagination
            align="right"
            class="pagination"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="curPage"
            :page-sizes="PAGE_NUMBER"
            :page-size="pageSize"
            :layout="PAGINATION_LAYOUT"
            :total="totalElements"
          />
        </el-tab-pane>
      </el-tabs>
      <div
        v-viewer
        ref="registration"
        class="registration"
        v-show="false">
        <el-image
          style="width: 250px; height: 150px;"
          :src="registUrl"
          fit="cover" />
      </div>
      <!-- 查看历史记录 -->
      <el-dialog
        title="历史记录"
        :visible.sync="isShowHistory">
        <el-editable
          v-loading="historyLoading"
          :data="historyDataList"
          height="400"
          :columns="historyTableData"
        />
        <span
          slot="footer"
          class="dialog-footer">
          <el-button
            type="primary"
            @click="isShowHistory = false">确 定</el-button>
        </span>
      </el-dialog>
      <!-- 审核驳回填写备注 -->
      <el-dialog
        width="30%"
        title="准入驳回"
        :visible.sync="isShowReject">
        <p style="margin-bottom:10px;">备注:</p>
        <el-input
          type="textarea"
          :rows="6"
          placeholder="请输入"
          v-model="rejectsRemarks" />
        <span
          slot="footer"
          class="dialog-footer">
          <el-button @click="rejectCancel">取消</el-button>
          <el-button
            type="primary"
            @click="rejectDetermine">确 定</el-button>
        </span>
      </el-dialog>
    </el-container>
  </div>
</template>
<script>
import { hasIn } from 'lodash'
import ElEditable from '@components/el-editable'
import SearchForm from '@components/businesscomponents/search'
import picInfoCard from '@/moduleComponents/distributorSide/distributionAdmittance/picInfoCard'
import CellRegistration from '@/moduleComponents/common/detail/cell-registration'
import {
  companygetAcCompanyInfoAll,
  pcHosDistributorProdApplyGetApplyProdByConstrict,
  authSupplierHospitalSelectcAcAuditRecord,
  relateProdDistributorAndHospital,
  authSupplierHospitalupdateHosProdCode,
  authSupplierHospitalAuditingByHospital,
  hospitalistHosProducts,
  acAuthQualificationGetByCompany,
  acAuthQualificationGgetBySalar
} from '@const/beforeSettleApi'
import { urlDownload, fileDownload } from '@const/utils.js'
import { PAGE_NUMBER, PAGINATION_LAYOUT } from '@const/common'
import { regisNoButton, showPdfRegistion } from '@const/agencySaas'

import RecordInfo from '@/moduleComponents/beforeSettle/distributorSide/purchasingManagement/rowLayout'
import {
  enterpriseForm,
  financeForm,
  supplementForm,
  salespersonForm,
  IDcardsForm,
  searchDataForm,
  productColumns,
  registerColumns,
  historyTableData,
  defaultImgUrl,
  businessScope
} from './const'
export default {
  components: { ElEditable, RecordInfo, SearchForm, CellRegistration, picInfoCard },
  data () {
    return {
      registUrl: '',
      isname: '1',
      salerList: [], // 多销售员数据
      timeout: null, // 延时
      hosProdCodeLoading: false,
      hosProdCodeList: [], // 院内编码下拉
      hosProdId: '', // 院内编码选择后取得产品id
      hospitalId: '', // 原数据的医院id
      hospitalName: '', // 医院名称
      businessScope, // 企业的经营范围
      defaultImgUrl,
      detailInfo: {}, // 保存列表页面session的信息
      id: '', // id
      authState: '', // 审核的状态
      changeHosProdCode: 0, // 是否允许编辑院内编码
      isShowReject: false,
      rejectsRemarks: '', // 驳回备注
      activeName: '1',
      // -----企业信息相关-----
      enterpriseForm, // 基本信息表单
      enterpriseInfo: {},
      financeForm, // 财务信息表单
      financeInfo: {},
      // 证照信息
      licenceInfo: [],
      supplementForm,
      supplementInfo: {},
      // -----销售人员相关-----
      salespersonForm, // 销售人员信息
      IDcardsForm, // 身份证信息
      IDcardsInfo: {},
      IDcardsArr: [],
      // 授权书
      authorizationInfo: [],
      // ------申请准入产品相关------
      searchDataForm,
      searchData: {}, // 搜索
      submitLoading: false,
      activeNameProduct: '1',
      tableLoading: false,
      dataList: [], // 产品数据
      productArr: productColumns,
      productColumns, // 产品表头
      registerColumns, // 注册证表头

      curPage: 1, // 当前页
      PAGE_NUMBER, // 页码数组
      PAGINATION_LAYOUT, // 页码功能布局
      pageSize: PAGE_NUMBER[0], // 一页的数量
      totalElements: 0, // 总共的条数
      isShowHistory: false, // 是否显示审核历史
      historyLoading: false,
      historyDataList: [], // 历史记录数据
      historyTableData
    }
  },
  computed: {
    dialogAutoHeight () {
      return {
        overflow: 'auto',
        height: '54vh'
      }
    }
  },
  created () {
    this.init()
  },
  mounted () {
    // this._initGlobalBtn()
  },
  methods: {
    regisNoButton,
    showPdfRegistion,
    // 初始化
    init () {
      this.getRouteQuery()
      this.getCompanyInfo()
      this.getAcCompanyInfo()
      this.getSalarInfo()
      this.getProductList()
    },
    // 获取院内编码 当前数据的初始化
    hosProdCodeListAndhosProdIdInit () {
      this.hosProdCodeList = []
      this.hosProdId = ''
    },
    // 院内编码模糊搜索后选择 把对应下拉中的产品id取出来
    gethosProdId (e) {
      let obj = this.hosProdCodeList.find(item => item.companyProdCode === e)
      this.hosProdId = obj.id ? obj.id : ''
    },
    // 编辑院内码
    editHosProdCode (row) {
      this.$set(row, 'isEditcode', true)
    },
    // 更新院内编码维护关系
    updateHosProdCodeById (row) {
      if (!this.hosProdId) {
        this.$set(row, 'isEditcode', false)
        return
      }
      this.$axios({
        method: 'post',
        url: relateProdDistributorAndHospital,
        data: {
          hosProdId: this.hosProdId,
          hospitalId: row.hospitalId,
          hospitalName: row.hospitalName,
          platProdCode: row.platCode,
          companyId: this.distributorId,
          companyProdId: row.companyProdId || '', // 按实际传参
          authItemId: row.distributorProdItemId
        }
      })
        .then(res => {
          if (res.data.code === '0') {
            this.$message({
              type: 'success',
              message: '编辑成功'
            })
            this.getProductList()
            this.$set(row, 'isEditcode', false)
          }
        })
        .finally(() => {
          this.tableLoading = false
        })
      // authSupplierHospitalupdateHosProdCode 军杰保存关系 realName
      console.log(536, row)
      this.$axios({
        method: 'post',
        url: authSupplierHospitalupdateHosProdCode,
        data: {
          id: row.id,
          hosProdCode: row.hosProdCode,
          hosProdItemId: this.hosProdId,
          constrictId: row.constrictId || '',
          role: this.$store.state.companyName,
          user: this.$store.state.realName
        }
      }).then(res => {
        console.log(res, '军杰对照接口')
      })
    },
    // 院内编码远程搜索
    remoteRequestAsync (queryString) {
      clearTimeout(this.timeout)
      this.timeout = setTimeout(() => {
        this.remoteRequestSearch(queryString)
      }, 1000 * Math.random())
    },
    // 院内编码远程请求接口
    remoteRequestSearch (queryString) {
      this.hosProdCodeLoading = true
      if (!queryString) return
      this.$axios({
        url: hospitalistHosProducts,
        method: 'post',
        data: {
          hospitalId: this.hospitalId,
          hosProdCode: queryString
        }
      })
        .then(res => {
          if (hasIn(res, ['data', 'payload'])) {
            this.hosProdCodeList = res.data.payload ? res.data.payload : []
          }
        })
        .finally(() => {
          this.hosProdCodeLoading = false
        })
    },
    // 获取申明产品列表数据 this.curPage = 1 this.pageSize
    getProductList (isname) {
      this.tableLoading = true
      this.$axios({
        url: pcHosDistributorProdApplyGetApplyProdByConstrict,
        method: 'post',
        data: {
          constrictId: this.id,
          type: this.isname,
          page: this.curPage,
          pageSize: this.pageSize,
          ...this.searchData
        }
      })
        .then(res => {
          if (hasIn(res, ['data', 'payload'])) {
            this.dataList = res.data.payload.content || []
            this.totalElements = res.data.payload.totalElements
          }
        })
        .finally(() => {
          this.tableLoading = false
        })
    },
    // 获取销售员的信息
    getSalarInfo () {
      this.$axios({
        url: acAuthQualificationGgetBySalar,
        method: 'post',
        data: {
          hospitalId: this.hospitalId,
          orderid: this.id,
          distributorId: this.distributorId
        }
      }).then(res => {
        if (hasIn(res, ['data', 'payload'])) {
          this.salerList = res.data.payload || []
          this.salerList.forEach(item => {
            this.$set(item, 'dateRanges', `${item.startDate.split(' ')[0]} - ${item.endDate.split(' ')[0]}`)
            item.IDcardsArr = [].concat([
              { url: item.identityFroet },
              { url: item.identityBack }
            ])
          })
        }
      })
    },
    // 获取企业证照
    getAcCompanyInfo () {
      this.$axios({
        url: acAuthQualificationGetByCompany,
        method: 'post',
        data: {
          hospitalId: this.hospitalId,
          orderid: this.id,
          distributorId: this.distributorId
        }
      }).then(res => {
        if (hasIn(res, ['data', 'payload'])) {
          let list = res.data.payload.companyQualifications || []
          let pdfReg = /\.(PDF|pdf)$/
          this.licenceInfo =
            list && list.length
              ? list.map(item => {
                if (pdfReg.test(item.url)) {
                  item.type = 'pdf'
                }
                return item
              })
              : []
        }
      })
    },
    // 查看注册证号
    viewCertificate (url) {
      if (!url) {
        this.$message({
          type: 'warning',
          message: '没有有效的路径'
        })
        return
      }
      this.registUrl = url
      if (/\w(\.gif|\.jpeg|\.png|\.jpg|\.bmp)/i.test(url)) {
        setTimeout(() => {
          const viewer = this.$refs['registration'].$viewer
          viewer.view(0)
        }, 600)
        return
      }
      if (url.includes('.pdf')) {
        this.$pdfViewer({ url, title: 'pdf预览' })
      }
    },
    // 获取企业信息
    getCompanyInfo () {
      this.$axios({
        method: 'post',
        url: companygetAcCompanyInfoAll,
        data: {
          cid: this.distributorId
        }
      }).then(res => {
        // 企业的基础信息
        if (hasIn(res, ['data', 'payload'])) {
          let data = res.data.payload.acCompanyBaseVo
          if (data.businessScope) {
            data.businessScope = data.businessScope.split(',')
          }
          this.enterpriseInfo = data
          // 财务信息
          this.financeInfo = res.data.payload.acCompanyFinanceVo
          // 补充信息
          this.supplementInfo = res.data.payload.acSupplementMessageVo
        }
      })
    },
    // 获取路由的参数
    getRouteQuery () {
      this.id = this.$route.query.id
      this.hospitalId = this.$route.query.hospitalId
      this.distributorId = this.$route.query.distributorId // 配送商的companyId
      this.authState = +this.$route.query.authState
      this.changeHosProdCode = this.authState === 3 ? 1 : 0
      this.detailInfo = sessionStorage.getItem('detailInfo')
        ? JSON.parse(sessionStorage.getItem('detailInfo'))
        : {}
      this.hospitalName = this.detailInfo.enterpriseName
    },
    // 预览图片
    previewFile (item, index, refName, type) {
      let url = item.url ? item.url : ''
      if (!url) return
      if (item.type === 'pdf') {
        this.$pdfViewer({ url, title: 'pdf预览' })
      } else {
        let viewer = type
          ? this.$refs[refName][0].$viewer
          : this.$refs[refName].$viewer
        viewer.view(index)
      }
    },
    // 下载图片、PDF
    downloadFile (url) {
      // fileDownload(url)
      if (!url) return
      urlDownload(url)
    },
    // tab企业信息、销售员、申请准入产品
    handleClick (e) {
      // console.log(e, this.activeName)
    },
    // tab按产品查看、按注册证查看1
    handleClickLookProduct (e) {
      this.curPage = 1
      this.isname = e.name
      this.getProductList(e.name)
    },
    // 查看资质
    lookQualifications (row) {
      this.$router.push({
        path:
          '/hospitalSide/channelManagement/distributionAdmittance/productQualification',
        query: {
          distributorProdItemId: row.distributorProdItemId,
          id: row.distributorProdItemId,
          hospitalId: row.hospitalId,
          hosProdCode: row.hosProdCode
        }
      })
    },
    // 查看产品（按注册证查看）
    lookProduct (row) {
      this.$router.push({
        path:
          '/hospitalSide/channelManagement/distributionAdmittance/seeProduct',
        query: {
          id: row.registId,
          hospitalId: this.hospitalId,
          hospitalName: this.hospitalName,
          changeHosProdCode: this.changeHosProdCode,
          constrictId: row.constrictId,
          registNo: row.registNo
        }
      })
    },
    // 查看历史记录
    lookHistory (row) {
      this.isShowHistory = true
      this.$axios({
        method: 'get',
        url: authSupplierHospitalSelectcAcAuditRecord,
        params: {
          authId: row.id,
          authType: 1
        }
      })
        .then(res => {
          if (hasIn(res, ['data', 'payload'])) {
            this.historyDataList = res.data.payload
          }
        })
        .catch(() => {
          this.isShowHistory = false
        })
    },
    // 搜索功能-点击查询
    searchForm (condition) {
      this.searchData = condition
      this.getProductList()
    },
    // 审核驳回
    reject () {
      this.isShowReject = true
    },
    rejectCancel () {
      this.isShowReject = false
      this.remark = ''
    },
    backList () {
      this.$router.push({
        path:
          '/hospitalSide/channelManagement/distributionAdmittance'
      })
    },
    // 确定审核驳回
    rejectDetermine () {
      this.isShowReject = false
      this.$axios({
        method: 'put',
        url: authSupplierHospitalAuditingByHospital,
        data: {
          id: this.id,
          remark: this.rejectsRemarks,
          authState: 5, // 驳回
          updatedBy: this.$store.state.realName
        }
      }).then(res => {
        if (res.data.code === '0') {
          this.$message({
            type: 'success',
            message: '驳回成功'
          })
          this.backList()
        }
      })
    },
    // 审核通过
    auditPass () {
      this.$axios({
        method: 'put',
        url: authSupplierHospitalAuditingByHospital,
        data: {
          id: this.id,
          authState: 3, // 审核通过
          updatedBy: this.$store.state.realName
        }
      }).then(res => {
        if (res.data.code === '0') {
          this.$message({
            type: 'success',
            message: '审核通过成功'
          })
          this.backList()
        }
      })
    },
    // 点击重置
    resetForm (condition) {
      this.curPage = 1
      this.searchData = condition
      this.getProductList()
    },
    // 页码更改
    handleSizeChange (size) {
      this.curPage = 1
      this.pageSize = size
      this.getProductList()
    },
    // 切换不一样的页面,重置一切数据
    handleCurrentChange (curPage) {
      this.curPage = curPage
      this.getProductList()
    },
    // 审核页面用
    _initGlobalBtn () {
      let obj = {
        type: 'btn',
        arr: [
          {
            type: 'button',
            noReturn: true,
            val: '返回',
            handle: this.globalCancel
          },
          { type: 'danger', val: '驳回', handle: this.reject },
          { type: 'primary', val: '通过', handle: this.auditPass }
        ]
      }
      this.$store.commit('changeLayoutHandle', obj)
    }
  },
  beforeDestroy () {
    // sessionStorage.removeItem('detailInfo')
  }
}
</script>
<style lang="less">
.distribution-admittance-examine {
  .no-pic {
    height: 120px;
    width: 250px;
    text-align: center;
    color: #a7b1c7;
    line-height: 120px;
  }
  .template-box {
    height: 100%;
    overflow: auto;
    .saler-item-info {
      border-bottom: 1px solid #f5f5f5;
      &:last-child {
        border-bottom: none;
      }
      &:not(:first-child) {
        padding-top: 20px;
      }
    }
    // 驳回原因
    .reject-box {
      margin-bottom: 10px;
      span:first-child {
        color: red;
      }
    }
    // 证照信息
    .licence-box {
      margin-top: 10px;
      display: flex;
      flex-wrap: wrap;
      .licence-every-box {
        width: 250px;
        height: 200px;
        margin-right: 20px;
        margin-bottom: 20px;
        border: 1px solid #ccc;
        .licence-button-box {
          display: flex;
          align-items: center;
          height: 50px;
          border-top: 1px solid #ccc;
          span {
            text-align: center;
            display: block;
            width: 50%;
            height: 80%;
          }
          span:first-child {
            border-right: 1px solid #ccc;
          }
        }
        .licence-url-box {
          width: 100%;
          height: 150px;
          display: flex;
          justify-content: center;
          align-items: center;
          .iconfont {
            font-size: 60px;
          }
        }
      }
    }
  }
  .licenceCard {
    display: inline-block;
    width: 376px;
    border-radius: 0;
    box-shadow: initial;
    margin: 0 16px 20px 0;
    position: relative;
  }
  .card-box {
    padding: 20px;
  }
}
</style>
